package com.hqyj.controller;

import com.hqyj.dao.SalaryDao;
import com.hqyj.entity.Salary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/salary")
public class SalarController {
    @Autowired
    SalaryDao salaryDao;
    @GetMapping
    @RequestMapping(value = "/findSalary")
    String salary(Model model,String year,String user_id){
        List<Salary> allByUser_idAndYear = salaryDao.getAllByUser_idAndYear("2", "2017");
        model.addAttribute("salary",allByUser_idAndYear);
        return "restful/salaryList";
    }
}
